﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="nofity.ascx.cs" Inherits="AnyOffice.general.mytable.nofity" %>
<script>
function open_notify(notify_id)
{
 URL="/general/notify/show/read_notify.aspx?notify_id="+notify_id;
 myleft=(screen.availWidth-500)/2;
 window.open(URL,"read_notify","height=400,width=550,status=1,toolbar=no,menubar=no,location=no,scrollbars=yes,top=150,left="+myleft+",resizable=yes");
}
</script>
<div id="module_1"  style="position: relative;padding-bottom:10px;">
<table class="TableBlock" width="100%" cellspacing="0" cellpadding="2">
  <tr class="TableHeader">
    <td id="module_1_head" class="TableHeader" width="70%">
		<img src="/images/menu/notify.gif" align="absMiddle"> 文件通知
	</td>
    <td id="module_1_more" align="right">  
		<div id="module_1_op" style="float:right;display:none;">&nbsp;<a id="module_1_url" href="#" onclick="_del('1');"></div>
		<div style="float:right">&nbsp;</div>
	</td>
  </tr>
  <tr class="TableData" style="background:#FFFFFF url(/images/water/notify.jpg) no-repeat bottom right">
    <td colspan="2" height="60">    
    	<div id="divNotify">
    	<asp:Repeater id="rptNotify" runat="server" EnableViewState="False">
		<ItemTemplate>
		·<a href="javascript:open_notify(<%#DataBinder.Eval(Container.DataItem,"NotifyId")%>);"><span style="<%# (Convert.ToBoolean(DataBinder.Eval(Container.DataItem,"Important").ToString()) == true) ? "font-weight: bold;color: #FF0000;" : ""%>">【<%#DataBinder.Eval(Container.DataItem,"TypeName")%>】<%#DataBinder.Eval(Container.DataItem,"Subject")%></span></a>(<%#Convert.ToDateTime(DataBinder.Eval(Container.DataItem,"SendTime")).ToString("d")%>)<%#DataBinder.Eval(Container.DataItem,"Readers") != DBNull.Value ? GetNew(DataBinder.Eval(Container.DataItem,"Readers").ToString()) : "<img src=/images/new.gif align=absmiddle>"%>
		<br>
		</ItemTemplate>
		</asp:Repeater>
		<asp:Literal id="litNotify" runat="server"></asp:Literal>
		</div>	
    </td>
  </tr>
</table>
</div>
<SCRIPT language="javascript">
CODE_IDSTR += "1,";
var timer_notify = null;
var str_notify = "";
function GetNotify()
{	
	if(timer_notify != null)
		window.clearTimeout(timer_notify);
		
	AnyOffice.general.mytable.AjaxMethods.GetNotify(CallBack_GetNotify);
	timer_notify=setTimeout("GetNotify()",AJAX_INTERVAL*10);
}
function CallBack_GetNotify(res)
{	
	if (res.error != null)
		return;
					
	if(str_notify != res.value)
		document.getElementById('divNotify').innerHTML = res.value;		
	str_notify = res.value;	
}
GetNotify();
</SCRIPT>

